//
//  DatabaseHandler.h
//  UI12_网络电影解析作业
//
//  Created by cuixin on 15/9/23.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "LDY_VoiceModel.h"
#import "CXFirstDetailModel.h"
@interface DatabaseHandler : NSObject


+(DatabaseHandler *)shareDatabaseHandler;

//打开数据库
-(void)openDB;

//创建数据库
//tableName:代表表名

#pragma mark 创建历史记录第一张表
-(void)createHistoryHomeTable:(NSString *)tableName;

#pragma mark 创建历史记录第二张表
-(void)createHistoryHotTable:(NSString *)tableName;


#pragma mark 历史记录第一张表插入
-(void)insertHistoryHome:(CXFirstDetailModel *)model;

#pragma mark 历史记录第二张表插入
-(void)insertHistoryHot:(LDY_VoiceModel *)model;



#pragma mark 删除第一个历史记录
-(void)deleteHistoryHome:(NSString *)name;

#pragma mark 删除第二个历史记录
-(void)deleteHistoryHot:(NSString *)name;

#pragma mark 删除历史全部第一张表
-(void)deleteHistoryHomeAll;

-(void)deleteHistoryHotAll;


#pragma mark 查询历史记录第一张表
-(NSMutableArray *)selectHistoryHome;

#pragma mark 查询历史记录是第二张表
-(NSMutableArray *)selectHistoryHot;


@end
